package com.zxc.shortlink.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.zxc.shortlink.controller.request.LinkMappingRequest;
import com.zxc.shortlink.pojo.LinkMapping;
import com.zxc.shortlink.pojo.enums.LinkMappingStateEnum;

import java.util.List;

/**
* @author zxc_user
* @date 2022/3/23 22:54
* @version 1.0
* @description LinkMapping服务层操作接口
**/
public interface LinkMappingService extends IService<LinkMapping> {
    /**
     * 根据状态查询符合条件的所有短链接
     * @param state
     * @return
     */
    List<String> queryAllShortLink(LinkMappingStateEnum state);

    /**
     * 根据短链接获取对应的长链接
     * @param shortLink
     * @return
     */
    String getOriginLinkByShortLink(String shortLink);

    /**
     * 创建一个新的链接
     * @param linkMappingRequest
     * @return
     */
    boolean saveLinkMapping(LinkMappingRequest linkMappingRequest);
}
